package com.admin.boot.common.config;

import cn.dev33.satoken.strategy.SaStrategy;
import com.admin.boot.common.utils.JwtUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

/**
 * @version v3.0
 * @Description: TODO
 * @author: jeecg-boot
 * @date: 2024-03-05
 */
@Configuration
public class SaTokenConfigure {

    @Autowired
    public void rewriteSaStrategy() {
        // 重写 Token 生成策略
        SaStrategy.instance.createToken = (loginId,loginType) -> JwtUtil.sign(loginId.toString(),loginType);
    }
}
